<!DOCTYPE html>
<html lang="en">
<head>
    <title>教师信息管理系统</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="../css/colorpicker.css" />
    <link rel="stylesheet" href="../css/datepicker.css" />
    <link rel="stylesheet" href="../css/uniform.css" />
    <link rel="stylesheet" href="../css/select2.css" />
    <link rel="stylesheet" href="../css/matrix-style2.css" />
    <link rel="stylesheet" href="../css/matrix-media.css" />
    <link rel="stylesheet" href="../css/bootstrap-wysihtml5.css" />
    <link href="../font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>

    <style>
        .control-group .controls label{
            display:inline-block;
        }
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }

    </style>

</head>
<body>

<div id="content">
    <div id="content-header">
        <h1>权限管理</h1>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div id="form_2" class="span12">
                <div class="widget-box">
                    <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
                        <h5>权限管理</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <span id="span1" style="color: red;" className=""></span>
                        <form id="basic" action="#" method="get" class="form-horizontal">
                            <input id="id" name="id" type="text" style="display: none">
                            <div class="control-group">
                                <label class="control-label">手机号：</label>
                                <div class="controls">
                                    <input id="tel" name="tel" type="text" class="span11" placeholder="输入手机号点击查询" />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">用户名：</label>
                                <div class="controls">
                                    <input name="username" type="text" class="span11" placeholder="name" />
                                </div>
                            </div>
                            <div  >
                                <label class="control-label">权限选择：</label>
                                <div  class="controls">
                                    <select id="type" name="type">
                                        <option value="0">教师权限（仅操作个人信息）</option>
                                        <option value="1">管理权限（管理所有平台用户）</option>
                                        <option value="2">超级管理（可修改其他用户权限）</option>
                                    </select>
                                </div>
                            </div>
                        </form>

                        <center>
                            <button id="btn1" class="btn btn-info btn-large" style="margin-bottom: 20px;border-radius: 5px">保存</button>
                        </center>

                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<script src="http://www.jq22.com/jquery/jquery-1.7.1.js"></script>
<script src="../js/jquery.ui.custom.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-colorpicker.js"></script>
<script src="../js/bootstrap-datepicker.js"></script>

<script src="../js/masked.js"></script>
<script src="../js/jquery.uniform.js"></script>
<script src="../js/select2.min.js"></script>
<script src="../js/matrix.js"></script>
<script src="../js/matrix.form_common.js"></script>
<script src="../js/wysihtml5-0.3.0.js"></script>
<script src="../js/jquery.peity.min.js"></script>
<script src="../js/bootstrap-wysihtml5.js"></script>
<script type="text/javascript" src="../js/jquery.cookie.js"></script>
<script src="../js/tool.js"></script>
<script>
    $(function () {
        $("#tel").live("blur",function () {
                $.get("/users/getUsersInfo/"+$(this).val(),{},function (result) {
                    if (result.resp_code=="0"){
                        loadData(result.datas);
                    }
                },"json")
        })
        $("#btn1").click(function () {
            var r = confirm("\t\t确定保存？");
            if (r == true) {
                var type=$("#type").val();
                $.post("/users/editUsersInfo",{tel:$("#tel").val(),type:type},function (result) {
                    if (result.resp_code == "0") {
                        alert(result.resp_msg);
                        window.location.href="users.html";
                    }else {
                        $("#span1").val(result.resp_msg);
                    }
                },"json")
            }
        })
    })

</script>
</body>
</html>
